﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dror.Common.Data.Contracts;
using Dror.Common.Data.NHibernate;
using System.Configuration;

namespace DBCreator
{
    class Program
    {
        static void Main(string[] args)
        {
            var sessionFactory = new SessionFactory();

            Console.WriteLine("Finished Creating Tables!");
            Console.WriteLine("inserting new data...");
            IRepository repository = new NHibernateRepository(sessionFactory);
            
            try
            {
                repository.BeginTransaction();
                repository.CommitTransaction();
            }
            catch (Exception e)
            {
                repository.RollbackTransaction();
                repository.CloseSession();
            }
            Console.WriteLine("Finished!");
            Console.ReadKey();
        }
    }
}
